<template>
<div class="recycle-pay-management views-container">
    <div class="wlm-table">
        <div class="wlm-table-content">
            <el-table :ref="tableFormatData.announcement.key" :data="tableFormatData.announcement.tableData" @selection-change="handleSelectionChange" style="width: 100%">
                <el-table-column prop="date" label="支付名称" >
                    <template slot-scope="scope">
                        <span>{{scope.row.name}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="date" label="支付类型" >
                    <template slot-scope="scope">
                        <span>{{scope.row.type=='1'?'微信支付':scope.row.type=='2'?'支付宝支付':''}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="状态" >
                    <template slot-scope="scope">
                        <span class="orders-green" v-if="scope.row.status==1">使用中</span>
                        <span class="orders-gray" v-if="scope.row.status!=1">未使用</span>
                    </template>
                </el-table-column>
                <el-table-column prop="address" label="操作" >
                    <template slot-scope="scope">
                        <div class="operation-group">
                            <el-button class="wlm-text" type="text" @click="changeTableItem({ids:[scope.row.id],type:'payment_method'},tableFormatData.announcement.change.restore)">恢复</el-button>
                            <div class="btn-line"></div>
                            <el-button class="wlm-text" type="text" @click="delTableItem(scope.row.id)">删除</el-button>
                        </div>
                    </template>
                </el-table-column>
            </el-table>
        </div>
    </div>
</div>
</template>

<script>
import {
  getDelPaymentMethodList,
  recoveryDeletedInfo,
  deleteThoroughlyInfo
} from '@/api/recycle'
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Table')],
  name: 'RecyclePayManagement',
  components: {

  },
  data() {
    return {
      tableFormatData: {
        current: 'announcement',
        announcement: {
          key: 'announcement',
          api: {
            getList: getDelPaymentMethodList,
            delList: deleteThoroughlyInfo
          },
          tableData: [],
          files: {
            ids: [],
            checkall: '0',
            type: 'payment_method'
          },
          change: {
            restore: {
              name: '恢复',
              key: 'restore',
              api: recoveryDeletedInfo
            }
          },
          noPages: true,
          pagination: {
            page: 1,
            list_rows: 10,
            pagesizes: [10, 20, 50],
            total: 0
          }
        }
      }
    }
  },
  methods: {

  }
}
</script>
